# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Ionut Biru <ibiru@archlinux.org>


pkgname=libgedit-gtksourceview
pkgver=299.0.4
pkgrel=2
pkgdesc="A source code editing widget"
arch=(loong64 x86_64)
url="https://gedit-technology.net/"
license=('LGPL2.1')
depends=(
  cairo
  gdk-pixbuf2
  gtk3
  libxml2
  pango
)
makedepends=(
  git
  gobject-introspection
  gtk-doc
  meson
)
checkdepends=(xorg-server-xvfb)
provides=(libgedit-gtksourceview-300.so)
_commit=7062264d635f6efe04d88217a893a97ff385b873  # tags/299.0.4^0
source=("git+https://github.com/gedit-technology/libgedit-gtksourceview.git#commit=$_commit")
sha256sums=('SKIP')

prepare() {
  cd $pkgname
}

build() {
  local meson_options=(
    -D gtk_doc=true
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() {
  dbus-run-session xvfb-run -s '-nolisten local' \
    meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}
